<?php
class password extends MY_Controller{
    function password(){
        parent::MY_Controller();
        $this->load->model('m_user');
        $this->data['title'] = "Form Ubah Password";
    }
    function index(){
        $idUser = $this->session->userdata('id');
        $this->data['content'] = "password/v_password";
        $this->data['subLink'] = "password/ubahPasswordProses";
        $this->data['listUser'] = $this->m_user->getUserById($idUser);
        $this->render($this->data);
    }
    function ubahPasswordProses(){
        $update = $this->m_user->ubahPassword($_POST);
        if($update == TRUE){
            $this->session->set_flashdata("message",1);
        }else{
            $this->session->set_flashdata("message",2);
        }
        
        redirect('password');
    }
}
?>
